From: Giovanni Campagna Date: Fri, 17 Aug 2012 12:24:17 +0000 (+0200) Subject: ScreenShield: listen to login managers to unlock the session X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6165 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b6375d3e4066a34d530b91e89035a9f2408ff81d;p=gnome-shell.git ScreenShield: listen to login managers to unlock the session Handle locking and unlocking from outside. This fixes coming back from fast user switching. https://bugzilla.gnome.org/show_bug.cgi?id=682096 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index c4a23b6e9..0fb410781 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -8,11 +8,13 @@ const Meta = imports.gi.Meta; const Signals = imports.signals; const St = imports.gi.St; +const ConsoleKit = imports.misc.consoleKit; const GnomeSession = imports.misc.gnomeSession; const Layout = imports.ui.layout; const Lightbox = imports.ui.lightbox; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; +const Systemd = imports.misc.systemd; const Tweener = imports.ui.tweener; const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver'; @@ -340,6 +342,16 @@ const ScreenShield = new Lang.Class({ this._onStatusChanged(status); })); + if (Systemd.haveSystemd()) { + this._systemdProxy = new Systemd.SystemdLoginSession(GLib.getenv('XDG_SESSION_ID')); + this._systemdProxy.connectSignal('Lock', Lang.bind(this, function() { this.lock(false); })); + this._systemdProxy.connectSignal('Unlock', Lang.bind(this, function() { this.unlock(); })); + } else { + this._consoleKitProxy = new ConsoleKit.ConsoleKitManager(); + this._consoleKitProxy.ckSession.connectSignal('Lock', Lang.bind(this, function() { this.lock(false); })); + this._consoleKitProxy.ckSession.connectSignal('Unlock', Lang.bind(this, function() { this.unlock(); })); + } + this._settings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA }); this._isModal = false;